package com.bond.cloud.consumer;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = MqConstantInfo.topic, consumerGroup = MqConstantInfo.consumerGroup)
public class RocketMQConsumerListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        // 处理接收到的消息
        System.out.println("收到 topic=" + MqConstantInfo.topic + ",consumerGroup=" + MqConstantInfo.consumerGroup + " message: " + message);
    }
}